package org.xg.study.pd.channel;

import org.xg.study.pd.mode.IPayMode;

import java.math.BigDecimal;

/**
 *@cLassName ZFBPay
 *@description
 *@author CMG
 *@date 2021/9/14 14:59
 *@version 1.0
 **/
public class ZFBPay extends Pay{
    public ZFBPay(IPayMode payMode){
        super(payMode);
    }

    @Override
    public String transfer(String uId, String tradeId, BigDecimal amount) {
        logger.info("模拟支付宝渠道支付划账开始。uId: {}, tradeId: {}, amount: {}",uId,tradeId,amount);
        boolean security = payMode.security(uId);
        logger.info("模拟支付宝渠道支付风险校验。uId: {}, tradeId: {}, amount: {}",uId,tradeId,amount);
        if(!security){
            logger.info("模拟支付宝渠道支付划账拦截。uId: {}, tradeId: {}, amount: {}",uId,tradeId,amount);
            return "0001";
        }
        logger.info("模拟支付宝渠道支付划账成功。uId: {}, tradeId: {}, amount: {}",uId,tradeId,amount);
        return "0000";
    }
}
